<link type="text/css" rel="stylesheet" href="/public/js_calendar/dhtmlgoodies_calendar.css" media="screen"></LINK>
<script type="text/javascript" src="/public/js_calendar/dhtmlgoodies_calendar.js"></script>
<h2><?php echo $this->escape($this->content_title);?></h2>
<div class="form">
 <form class="niceform"  action="/lesson/<?php echo $this->action; ?>/id/<?php echo $this->item->id; ?>" method="post">
 <input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
 
        <fieldset>
            <?php if(!empty($this->message)) :?>
            <dl id="message">
                <dt></dt>
                <dd><b style="color:red;"><?php echo $this->message;?></b></dd>
            </dl>
            <?php endif; ?>
            <dl>
                <dt><label for="name">Name</label></dt>
                <dd><input type="text" size="54" id="name" name="name" value="<?php echo $this->escape(trim($this->item->name));?>"></dd>
            </dl> 
            <dl>
                <dt><label for="teacher_id">Teacher</label></dt>
                <dd>
                    <select id="teacher_id" name="teacher_id" size="1">
                        <?php foreach($this->teacher_ids as $value) { ?> 
                        <option value="<?php echo $value->id;?>" <?php echo $this->escape(trim($this->item->teacher_id))==$value->id?' selected ':'';?>><?php echo $value->first_name.' '.$value->last_name;?></option>
                        <?php } ?>
                    </select>
                </dd>
            </dl>
            
            <dl>
                <dt><label for="status">Status</label></dt>
                <dd>
                    <select id="status" name="status" size="1">
                        <?php foreach($this->statuss as $key=>$value) { ?> 
                        <option value="<?php echo $key;?>" <?php echo $this->escape(trim($this->status))==$key?' selected ':'';?>><?php echo $value;?></option>
                        <?php } ?>
                    </select>
                </dd>
            </dl> 
            
            <dl>
                <dt><label for="start_date">Start date</label></dt>
                <dd><input type="text" size="10" id="start_date" name="start_date" value="<?php echo $this->escape(trim($this->item->start_date));?>">
                <img id="birthday_trigger" src="/public/images/cal.gif" style="padding:6px;" onclick="displayCalendar(document.getElementById('start_date'),'yyyy-mm-dd',this);"></dd>
            </dl>
            
            <dl>
                <dt><label for="start_time">Start time</label></dt>
                <dd><input type="text" size="5" id="start_time" name="start_time" value="<?php echo $this->escape(substr(trim($this->item->start_time),0,5));?>">
            </dl>
            
            <dl>
                <dt><label for="end_time">End time</label></dt>
                <dd><input type="text" size="5" id="end_time" name="end_time" value="<?php echo $this->escape(substr(trim($this->item->end_time),0,5));?>">
            </dl>
            
            <dl>
                <dt><label for="type">Type</label></dt>
                <dd>
                    <select id="type" name="type" size="1">
                        <?php foreach($this->types as $key=>$value) { ?> 
                        <option value="<?php echo $key;?>" <?php echo $this->escape(trim($this->item->type))==$key?' selected ':'';?>><?php echo $value;?></option>
                        <?php } ?>
                    </select>
                </dd>
            </dl>        
            
            <dl>
                <dt><label for="studygroup_id">Studygroup id</label></dt>
                <dd>
                    <select id="studygroup_id" name="studygroup_id" size="1">
                        <?php foreach($this->studygroup_ids as $value) { ?> 
                        <option value="<?php echo $value->id;?>" <?php echo $this->escape(trim($this->item->studygroup_id))==$value->id?' selected ':'';?>><?php echo $value->name;?></option>
                        <?php } ?>
                    </select>
                </dd>
            </dl>        
            
            <dl>
                <dt><label for="comments">Comments</label></dt>
                <dd><textarea name="comments" id="comments" rows="5" cols="36"><?php echo $this->escape(trim($this->item->comments));?></textarea></dd>
            </dl>
            
             <dl class="submit">
                <a href="javascript:document.forms[0].submit();" class="bt_blue"><span class="bt_blue_lft"></span><strong>Save</strong><span class="bt_blue_r"></span></a>
                <a href="/lesson" class="bt_blue"><span class="bt_blue_lft"></span><strong>Cancel</strong><span class="bt_blue_r"></span></a>
             </dl>
            
        </fieldset>
        
 </form>
 </div>